﻿<%@ Page Language="C#" MasterPageFile="Module.master" AutoEventWireup="true" CodeFile="Module.aspx.cs"
    Inherits="Modules_Module" Title="Module" %>

<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxDataView" TagPrefix="dxdv" %>
<script runat="server" language="C#">

    void FocusedRowChanged(object sender, EventArgs e)
    {
        //groupList.
        int n = groupList.FocusedRowIndex;
        if (n >= 0)
        {
            DataRow dr = groupList.GetDataRow(n);
            string s = dr["Id"].ToString();
            dsItem.FilterExpression = "ddGroupId=" + s;
            itemList.DataBind();
        }
    }
    
    </script>


<asp:Content ID="Head1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="content" runat="Server">
    <wilson:DataSource ID="dsGroup" runat="server" ObjectSpace="Touchmax.Manager.ORManager"
        TypeName="Touchmax.DdGroup" KeyMember=Id" FilterExpression="ddGroupLink>0"  />
    <wilson:DataSource ID="dsItem" runat="server" ObjectSpace="Touchmax.Manager.ORManager"
        TypeName="Touchmax.DdItem" KeyMember=Id" FilterExpression="ddGroupId=1001" />

    <asp:ScriptManager ID="ScriptManager" runat="server">  </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
        <table style="margin-top:5px;">
        
        <tr>
        
        <td valign=top width=150>
        
        <dxwgv:ASPxGridView ID="groupList" ClientInstanceName="groupList" runat="server" DataSourceID="dsGroup" EnableCallBacks="False"
            Width="120" KeyFieldName="Id"   AutoGenerateColumns="False" OnFocusedRowChanged="FocusedRowChanged" >
            <SettingsPager PageSize="100" >
            </SettingsPager>
            <SettingsBehavior AllowFocusedRow="true" ProcessFocusedRowChangedOnServer="true" />
            <Settings ShowFilterRow="false" ShowColumnHeaders="false" />
             <Styles>
             <AlternatingRow Enabled="true"/>
         </Styles>

            <Columns>
                <dxwgv:GridViewDataTextColumn Caption="Name" FieldName="Note" VisibleIndex="2">
                </dxwgv:GridViewDataTextColumn>
            </Columns>
        </dxwgv:ASPxGridView>
        </td>
        

        <td valign=top width=300>
        
        <dxwgv:ASPxGridView ID="itemList" ClientInstanceName="itemList" runat="server" DataSourceID="dsItem" EnableCallBacks="False"
            Width="200" KeyFieldName="Id"  AutoGenerateColumns="False" OnFocusedRowChanged="FocusedRowChanged" >
            <SettingsPager PageSize="18" >
            </SettingsPager>
            <SettingsBehavior AllowFocusedRow="true" />
            <Settings ShowFilterRow="false" ShowColumnHeaders="false" />
             <Styles>
             <AlternatingRow Enabled="true"/>
         </Styles>

            <Columns>
                <dxwgv:GridViewCommandColumn >
                    <EditButton Visible="true" Text="Edit"></EditButton>
                    <DeleteButton Visible="true" Text="Remove"></DeleteButton>
                </dxwgv:GridViewCommandColumn>
                <dxwgv:GridViewDataTextColumn Caption="Name" FieldName="Note" VisibleIndex="2">
                </dxwgv:GridViewDataTextColumn>
            </Columns>
        </dxwgv:ASPxGridView>
        
        </td>
        </tr>
        
        
        </table>


        </ContentTemplate>
    </asp:UpdatePanel>
    
    <table>
    
   
    
    </table>

</asp:Content>
